#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
typedef struct mem
{
	int X;
	int K;
	int d;
}M;
int cmp(const void* n1, const void* n2)
{
	return *(int*)n2 - *(int*)n1;
}
int main()
{
	int n = 0;
	scanf("%d", &n);
	n /= 364;
	int x = 100;
	int k = 1;
	M arr[100];
	int num = 0;
	for (x = 100; x >= 1; x--)
	{
		for (k = 1; k <= 100; k++)
		{
			if ((x + 3 * k) == n)
			{
				arr[num].K = k;
				arr[num].X = x;
				arr[num].d = x - k;
				num++;
			}
		}
	}
	qsort(&(arr[num].d), num, sizeof(int), cmp);
	printf("%d\n%d\n", arr[0].X, arr[0].K);
	return 0;
}
